<template>
	<view class="go-top" @click="go">
		<text>回到顶部</text>
	</view>
</template>

<script>
	export default {
		name:"goTop",
		data() {
			return {
				
			};
		},
		methods:{
			go(){
				console.log('回到顶部')
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300
				});
			}
		}
	}
</script>

<style scoped lang="scss">
.go-top{
	position: fixed;
	right: 20rpx;
	bottom:180rpx;
	width: 110rpx;
	height: 110rpx;
	background-color: #fff;
	border:1px solid #aaa;
	border-radius: 50%;
	font-size: 38rpx;
	opacity: 0.5;
	text-align: center;
	&:active{
		opacity:1;
	}
}
</style>